<html>
<head>
<TITLE>MarsEMS System</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/style.css" type=text/css rel=stylesheet>
{literal}
<SCRIPT language=JavaScript>
function checkForm(){
	var theform = window.document.form1
	if (theform.userid.value == ""){
		alert("The user shouldn't be empty. Please select one user.");	
		theform.userid.focus();
		return false;
	}else{
		return true;
	}
}
</script>
{/literal}
</head>

<body bgcolor="#FFFFFF" text="#000000">

<form name="form1" method="post" action="">
   <table width="100%" cellspacing="0" cellpadding="4">
    <tr bgcolor="#E4E4E4">
      <td width="35%" >User Group : 
	  <select name=groupid onChange="if (window.document.form1.groupid.value != '') submit(); else return false;">
	  	<option value="">--- Select ---</option>

		{html_options options=$arrGroupID selected=$groupid}
	</select>
</td>
      <td><font color="#FF0000">&nbsp;{$error_message}</font></td>
     </tr>
  </table>
    <table width="100%" cellspacing="1" cellpadding="4">
    <tr bgcolor="#E4E4E4"> 
      <td width="10%" align="center">ID</td>
      <td width="25%">Menu</td>
      <td width="41%">Summary</td>
      <td>Operation</td>
      </tr>
    {foreach item=per from=$arrPermissionList}
    <tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#E9EDED';" onMouseOut="this.style.backgroundColor='#FFFFFF'"> 
      <td width="10%" align="center">{$per.mid}</td>
      <td width="25%">{$per.name}</td>
      <td width="41%">{$per.remark}</td>
      <td>{html_checkboxes values=$per.arrOperationID checked=$per.arrOperationS name=arrOperation output=$per.arrOperationName separator=" "}</td>
      </tr>
    {/foreach}
    <tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#E9EDED';" onMouseOut="this.style.backgroundColor='#FFFFFF'"> 
      <td></td>
		<td width="25%" class="mainfont">
		  <!--<font face="arial" size="-1" color=black><B>All Views </b></font>
		  <input name="checkall" type="checkbox" id="checkall" value="1" onClick="checkAll()">--></td>
        <td width="41%" class="mainfont"><!--
			<font face="arial" size="-1" color=black><B>All Operations </b></font>
			<input name="checkall_" type="checkbox" id="checkall_" value="1" onClick="checkAll_()">--></td>
	  <td colspan="4" align="RIGHT"> 
	    <input type="submit" name="Submit" value="Submit" onClick="return checkForm()">
        <input type="reset" name="Reset" value="Reset"></td> 
    </tr>
  </table>
</form>

</body>
{literal}
<script>
function checkAll_(){

	  var form = document.forms["form1"];

		var flag = form.checkall_.checked;

		for (var i=0; i < form.length;i++)

		{		 	

			if (form.elements[i].name.substring(0,10)=='operation_')

			{		 

				form.elements[i].checked = flag;				

			}	

		}	

		return true;		

}



function checkAll(){

	  var form = document.forms["form1"];

		var flag = form.checkall.checked;

		for (var i=0; i < form.length;i++)

		{		 	

			if (form.elements[i].name.substring(0,5)=='view_')

			{		 

				form.elements[i].checked = flag;				

			}	

		}	

		return true;		
}
function pauseBid(){

	var form=document.forms["form1"]; 

	var err = false;

	var i = 0;

	//window.confirm("Are you sure want to ...");

	err = true;

	

	for (var i=0; i < form.length;i++)

	{

		if (form.elements[i].name.substring(0,5)=='view_' ||form.elements[i].name.substring(0,5)=='operation_')

		{		  

			if(form.elements[i].checked==true){

				err = false;

				break;

			}							

		}	

	}	

	

	if(!err){

			form.act.value = "pause";

			form.submit();

			return true;

	}else{

			//alert("all unchecked");

			return false;

	}	

}


</script>
{/literal}
</html>